<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
    const arr = [{ 'id': 1, 'name': 'ali' }, { 'id': 2, 'name': 'chenli' }, { 'id': 1, 'name': 'ali' }]
    let obj = {}
    const result = arr.reduce((cur, next) => {
        obj[next.id] ? ' ' : (obj[next.id] = true && cur.push(next))
        return cur
    }, [])
    console.log(result)
    </script>
</body>

</html>